package com.app.utils;

import android.content.Context;

import com.lidroid.xutils.BitmapUtils;

/**
 * wuxd
 */
public class BitmapHelp {
    private BitmapHelp() {
    }

    private static BitmapUtils bitmapUtilsHeadIcon;
    private static BitmapUtils bitmapUtilsCommon;

    /**
     * BitmapUtils不是单例的 根据需要重载多个获取实例的方法
     *
     * @param appContext application context
     * @return
     */
    public static BitmapUtils getBitmapUtils(Context appContext) {
        if (bitmapUtilsCommon == null) {
            bitmapUtilsCommon = new BitmapUtils(appContext);
        }
        return bitmapUtilsCommon;
    }

    /**
     * 自定义缓存目录
     * @param appContext
     * @param diskCachePath
     * @return
     */
    public static BitmapUtils getBitmapUtils(Context appContext,String diskCachePath) {
        if (bitmapUtilsHeadIcon == null) {
            bitmapUtilsHeadIcon = new BitmapUtils(appContext,diskCachePath);
        }
        return bitmapUtilsHeadIcon;
    }


}
